<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        
    </style>
</head>
<body>
    
</body>
<script>

    var n = 5;

    if( n >= 0 && n < 10 ){
        n = "0" + n;
    }

    console.log(n);

    // ============
    
    // 在分支语句的执行语句内最好不要直接做输出或打印，尽量先将结果保存，分支结束后统一处理
    var n = 3;
    var result;
    switch(n){
        case 0: result = "星期日"; break;
        case 1: result = "星期一"; break;
        case 2: result = "星期二"; break;
        case 3: result = "星期三"; break;
    }
    console.log(result);

    // ============


    
</script>
</html>